package regex;

public class Regex {
	public static void main(String[] args) {
		
		System.out.println(regexInteger("-33"));
		System.out.println(regexPosInteger("0"));
		System.out.println(regexEmail("=www.a@a.de"));
	}

	public static boolean regexInteger(String str){
		return str.matches("[+-]?[0-9]+");
	}
	
	public static boolean regexPosInteger(String str){
		return str.matches("[+]?[1-9][0-9]?");
	}
	
	public static boolean regexEmail(String str){
		return str.matches("^[\\w\\.=-]+@[\\w\\.-]+\\.[\\w]{2,4}$");
	}
}
